/** COPYRIGHT(C) 2008. Loc Phan. All Rights Reserved.
    A class that represents a coin
    Fully implemented by Loc Phan
    @author Loc Phan
    @version 1.01 2008-12-1
*/

package edu.sjsu.phan.postlab14;

public class Coin implements Comparable<Coin>
{
   /**Constructs a coin
    * 
    * @param d Value of the coin
    * @param string Representation in word
    */
   public Coin(double d, String string)
   {
      coin = d;
      coinName = string;
   }
   
   /**Return value of the coin
    * 
    * @return Value(in cents)
    */
   public double getValue()
   {
      return coin;
   }
   /**Compare 2 coins
    * 
    */
   public int compareTo(Coin o)
   {
      return o.getName().compareToIgnoreCase(coinName);
   }
   /**Returns coin name
    * 
    * @return Coin Name
    */
   public String getName()
   {
      return coinName;
   }
   private double coin;
   private String coinName;
}